package gov.army.workshop.service.impl;

import gov.army.workshop.dao.GenericDao;
import gov.army.workshop.model.JobDetail;
import gov.army.workshop.model.Payment;
import gov.army.workshop.model.WorkItem;
import gov.army.workshop.model.Workorder;
import gov.army.workshop.service.WorkorderManager;

import java.io.Serializable;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.flex.remoting.RemotingDestination;
import org.springframework.flex.remoting.RemotingInclude;

@RemotingDestination( channels = { "mySecureAmf" } )
public class WorkorderManagerImpl extends GenericManagerImpl<Workorder, Serializable> implements WorkorderManager{
	
	@Autowired
	private GenericDao<Workorder, Serializable> workorderDao;
	
	@Autowired
	private GenericDao<WorkItem, Serializable> workItemDao;
	@Autowired
	private GenericDao<JobDetail, Serializable> jobDetailDao;
	@Autowired
	private GenericDao<Payment, Serializable> paymentDao;
	
	
	/**
	 * @param workorderDao the workorderDao to set
	 */
	public void setWorkorderDao(GenericDao<Workorder, Serializable> workorderDao) {
		log.debug(workorderDao);
		this.dao=workorderDao;
		this.workorderDao = workorderDao;
	}

	/**
	 * @param workItemDao the workItemDao to set
	 */
	public void setWorkItemDao(GenericDao<WorkItem, Serializable> workItemDao) {		
		this.workItemDao = workItemDao;
	}

	/**
	 * @param jobDetailDao the jobDetailDao to set
	 */
	public void setJobDetailDao(GenericDao<JobDetail, Serializable> jobDetailDao) {
		this.jobDetailDao = jobDetailDao;
	}

	/**
	 * @param paymentDao the paymentDao to set
	 */
	public void setPaymentDao(GenericDao<Payment, Serializable> paymentDao) {
		this.paymentDao = paymentDao;
	}

	
	
	@RemotingInclude
	public Workorder save(Workorder object) {
		log.debug(object);
		return super.save(object);
	}
	
	public void createPdf(Workorder workorder){
		
	}
	
}
